<!--
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-03-29 18:15:18
 * @LastEditors: voanit
 * @LastEditTime: 2022-03-29 18:59:51
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.26.1/axios.min.js"></script>
</head>

<body>
  <script>
    // axios.get('').then(()=>{}).catch()
    // axios.get('https://apipc-xiaotuxian-front.itheima.net/home/category/head').then(res => {
    //   console.log(res, 99);
    // })
    function PP () {
      /* 包装器 */
      return new Promise((resolve, reject) => {
        axios.get('https://apipc-xiaotuxian-front.itheima.net/home/category/head').then(res => {
          resolve(res)
        })
      })
    }
    // console.log();
    PP().then(res => {
      console.log(res, 77);
    })
  </script>
</body>

</html>